<template>
  <div>
    <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="{path:'/'}">首页</el-breadcrumb-item>
      <el-breadcrumb-item :to="{path:'/bid/list'}">公告列表页</el-breadcrumb-item>
      <el-breadcrumb-item >公告详情页</el-breadcrumb-item>
    </el-breadcrumb>
    <div class="contain">
      <h1 class="title" style="font-size: 28px;">{{ bidTitle }}</h1>
      <div class="publish">
        <span style="color: #333;font-size: 14px;">发布企业：</span>
        <span style="color: #666;font-size: 14px;margin-right: 10px;">{{ publisher }}</span>
        <span style="color: #333;font-size: 14px;">发布时间：</span>
        <span style="color: #666;font-size: 14px;">{{ publishDataTime }}</span>
      </div>
      <div class="bidContent" ref="bidContent" style="text-align: left;"></div>
      <div class="downFile">
        <ul>
          <template v-for="item in fileList">
            <li @click="download(item.fileName)">
              <span>附件：</span>
              <span>{{ item.fileName }}</span>
            </li>
          </template>
        </ul>
      </div>
    </div>
  </div>
</template>

<script>
import {getBidding} from '@/api/bid/bidding'
import {download} from '@/utils/neu'
export default {
  name: "detail",
  methods: {
    download(fileName){
      download(fileName)
    }
  },
  data() {
    return {
      id:null,
     bidTitle:'',
     publishDataTime:'',
     publisher:'',
     bidContent:'',
     fileList:[],
    }
  },
  async created() {
   this.id=this.$route.query.id
   getBidding(this.id).then(res=>{
    this.bidTitle = res.data.bidTitle
    this.publisher = res.data.bidPublisher
    this.publishDataTime = this.parseTime(res.data.bidPublishDatetime,'{y}年{m}月{d}日')
    this.bidContent = res.data.bidContent
    this.$refs.bidContent.innerHTML = this.bidContent
    this.fileList = res.data.filesList
   })
  },
  mounted() {
    
  },

}
</script>

<style lang="scss" scoped>
.contain{
  background-color: #fff;
  padding: 20px;
  margin-left: 5px;
  border-radius: 5px;

  .downFile{
    ul{
      li{
        text-align: left;
        list-style: none;
        font-size: 14px;
        color: gray;
      }

      li:hover{
        color: #17c2aa;
        cursor: pointer;
      }
    }
  }
}
</style>
